import React from "react";
import { Navigate } from "react-router-dom";
import { RouteObject } from "@/routes/interface";
import Layout from "@/layouts";
import lazyLoad from "@/routes/utils/lazyLoad";

const merchant: Array<RouteObject> = [
	{
		element: <Layout />,
		meta: {
			title: "店铺管理",
			key: "merchant"
		},
		children: [
			{
				path: "/merchants",
				element: lazyLoad(React.lazy(() => import("@/pages/merchant/list/index"))),
				meta: {
					title: "所有店铺",
					requiresAuth: true,
					key: "merchants",
					icon: ""
				}
			},
			{
				path: "/merchants/address",
				element: lazyLoad(React.lazy(() => import("@/pages/merchant/address/index"))),
				meta: {
					title: "设置地址",
					requiresAuth: true,
					key: "/merchants/address",
					icon: ""
				}
			},
			{
				path: "/merchants/address/add",
				element: lazyLoad(React.lazy(() => import("@/pages/merchant/address/Add"))),
				meta: {
					title: "设置地址-添加",
					requiresAuth: true,
					key: "/merchants/address/add",
					icon: ""
				}
			},
			{
				path: "/merchant/info",
				element: lazyLoad(React.lazy(() => import("@/pages/merchant/create/index"))),
				meta: {
					title: "创建店铺",
					requiresAuth: true,
					key: "/merchant/info",
					icon: ""
				}
			}
		]
	}
];

export default merchant;
